﻿<CC:AnimatedBasePage
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
	xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
	xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
	xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit" 
	xmlns:CC="clr-namespace:Clarity.Phone.Controls"
	xmlns:Custom="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" xmlns:ic="clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expression.Interactions" 
	xmlns:controlsPrimitives="clr-namespace:Microsoft.Phone.Controls.Primitives;assembly=Microsoft.Phone.Controls" 
	x:Class="TradeMo.ListingView"
	mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="800"
	d:DataContext="{d:DesignData SampleData/ListingViewSampleData.xaml}"
	SupportedOrientations="Portrait"  
	Orientation="Portrait" Background="Black" Foreground="White">
	
	<Grid x:Name="LayoutRoot" Background="#991B1B1B">
		<VisualStateManager.VisualStateGroups>
			<VisualStateGroup x:Name="PopupVisualStateGroup">
				<VisualStateGroup.Transitions>
					<VisualTransition GeneratedDuration="0:0:0.3">
						<VisualTransition.GeneratedEasingFunction>
							<CubicEase EasingMode="EaseOut"/>
						</VisualTransition.GeneratedEasingFunction>
					</VisualTransition>
				</VisualStateGroup.Transitions>
				<VisualState x:Name="NoPopup"/>
				<VisualState x:Name="AskQuestionState">
					<Storyboard>
						<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="AskQuestionBorder">
							<DiscreteObjectKeyFrame KeyTime="0">
								<DiscreteObjectKeyFrame.Value>
									<Visibility>Visible</Visibility>
								</DiscreteObjectKeyFrame.Value>
							</DiscreteObjectKeyFrame>
						</ObjectAnimationUsingKeyFrames>
						<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="AskQuestionBorder" d:IsOptimized="True"/>
						<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="AskQuestionBorder" d:IsOptimized="True"/>
						<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="AskQuestionBorder" d:IsOptimized="True"/>
						<DoubleAnimation Duration="0" To="0.7" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="pivot" d:IsOptimized="True"/>
						<DoubleAnimation Duration="0" To="0.8" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="pivot" d:IsOptimized="True"/>
						<DoubleAnimation Duration="0" To="0.8" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="pivot" d:IsOptimized="True"/>
					</Storyboard>
				</VisualState>
				<VisualState x:Name="TrialModeState">
					<Storyboard>
						<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="TrialModeBorder">
							<DiscreteObjectKeyFrame KeyTime="0">
								<DiscreteObjectKeyFrame.Value>
									<Visibility>Visible</Visibility>
								</DiscreteObjectKeyFrame.Value>
							</DiscreteObjectKeyFrame>
						</ObjectAnimationUsingKeyFrames>
						<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="TrialModeBorder" d:IsOptimized="True"/>
						<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="TrialModeBorder" d:IsOptimized="True"/>
						<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="TrialModeBorder" d:IsOptimized="True"/>
						<DoubleAnimation Duration="0" To="0.7" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="pivot" d:IsOptimized="True"/>
						<DoubleAnimation Duration="0" To="0.8" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="pivot" d:IsOptimized="True"/>
						<DoubleAnimation Duration="0" To="0.8" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="pivot" d:IsOptimized="True"/>
					</Storyboard>
				</VisualState>
			</VisualStateGroup>
			<VisualStateGroup x:Name="LoadingVisualStateGroup">
				<VisualStateGroup.Transitions>
					<VisualTransition GeneratedDuration="0:0:0.3"/>
				</VisualStateGroup.Transitions>
				<VisualState x:Name="LoadingState">
					<Storyboard>
						<DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="pivot" d:IsOptimized="True"/>
					</Storyboard>
				</VisualState>
				<VisualState x:Name="LoadedState">
					<Storyboard>
						<DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="LoadingGrid" d:IsOptimized="True"/>
					</Storyboard>
				</VisualState>
			</VisualStateGroup>
		</VisualStateManager.VisualStateGroups>
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto"/>
			<RowDefinition/>
		</Grid.RowDefinitions>
		
		<Image Source="{Binding LargePicture, Mode=OneWay}" Opacity="0.35" Stretch="UniformToFill" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.RowSpan="2"/>
		<Grid Margin="12,0">
			<Grid.ColumnDefinitions>
				<ColumnDefinition/>
				<ColumnDefinition Width="Auto"/>
			</Grid.ColumnDefinitions>
			<TextBlock TextWrapping="Wrap" Text="{Binding Listing.Title}" Style="{StaticResource PhoneTextLargeStyle}" Margin="0" Foreground="#DEFFFFFF" />
			<Image Grid.Column="1" Source="/Images/flag_star.png" Width="32" VerticalAlignment="Top" Margin="0,12,0,0" Visibility="{Binding IsOnWatchList, Converter={StaticResource VisibilityConverter}}"/>
		</Grid>
		
		<controls:Pivot x:Name="pivot" Grid.Row="1" 
			RenderTransformOrigin="0.5,0.5" Style="{StaticResource PivotStyle1}" >
			<controls:Pivot.RenderTransform>
				<CompositeTransform/>
			</controls:Pivot.RenderTransform>
			<controls:PivotItem x:Name="SummaryPivotItem" Header="summary">
				<ScrollViewer>
					<Grid>
						<Grid.RowDefinitions>
							<RowDefinition Height="Auto"/>
							<RowDefinition Height="Auto"/>
							<RowDefinition Height="Auto"/>
							<RowDefinition Height="Auto"/>
							<RowDefinition Height="Auto"/>
							<RowDefinition Height="Auto"/>
							<RowDefinition Height="Auto"/>
						</Grid.RowDefinitions>
					
						<Border Grid.Row="0" Style="{StaticResource TradeMoBorderStyle}" >
							<ListBox x:Name="Breadcrumbs" ItemsSource="{Binding Breadcrumb}" SelectionChanged="Breadcrumbs_SelectionChanged" >
								<ListBox.ItemTemplate>
									<DataTemplate>
										<StackPanel Orientation="Horizontal">
											<TextBlock Text="{Binding Name}" Style="{StaticResource MoTextLargeStyle}"/> 
											<TextBlock Text=" &gt; " Style="{StaticResource MoTextBlockStyle}"/>
										</StackPanel>
									</DataTemplate>
								</ListBox.ItemTemplate>
								<ListBox.ItemsPanel>
									<ItemsPanelTemplate>
										<toolkit:WrapPanel/>
									</ItemsPanelTemplate>
								</ListBox.ItemsPanel>
							</ListBox>
						</Border>
					
						<Border Grid.Row="1" Style="{StaticResource TradeMoBorderStyle}" >
							<Grid>
								<Grid.RowDefinitions>
									<RowDefinition Height="Auto"/>
									<RowDefinition Height="Auto"/>
									<RowDefinition Height="Auto"/>
									<RowDefinition Height="Auto"/>
								</Grid.RowDefinitions>
								<Grid Grid.Row="0">
									<StackPanel Orientation="Horizontal" Margin="6,0,0,0">
										<Image Source="/Images/brandNewItem.png" Stretch="None" Margin="0,0,7,0" Visibility="{Binding Listing.IsNew, Converter={StaticResource VisibilityConverter}}"/>
										<StackPanel HorizontalAlignment="Left" Orientation="Horizontal" VerticalAlignment="Center" Visibility="{Binding NoReserve, Converter={StaticResource VisibilityConverter}}" >
											<Image Source="/Images/noReserve.png" Stretch="None" />
											<TextBlock Text="No reserve" Foreground="#99000000" VerticalAlignment="Center"/>
										</StackPanel>
										<StackPanel HorizontalAlignment="Left" Orientation="Horizontal" VerticalAlignment="Center" Visibility="{Binding IsReserveMet, Converter={StaticResource VisibilityConverter}}">
											<Image Source="/Images/reserveMet.png" Stretch="None" />
											<TextBlock Text="reserve met" Foreground="#99000000" VerticalAlignment="Center"/>
										</StackPanel>
										<Image Source="/Images/PayNowIcon.png" Stretch="None" Margin="6,0" Visibility="{Binding Listing.HasPayNow, Converter={StaticResource VisibilityConverter}}" />
										<Image Source="/Images/lmvd.png" Stretch="None" Margin="6,0" Visibility="{Binding IsDealer, Converter={StaticResource VisibilityConverter}}" />
									</StackPanel>
									<TextBlock HorizontalAlignment="Right" Text="{Binding TitleBids, Mode=OneWay}" Style="{StaticResource PhoneTextAccentStyle}"/>
								</Grid>
								<Grid Grid.Row="1" >
									<TextBlock Text="{Binding AuctionCloses}" HorizontalAlignment="Right" Style="{StaticResource PhoneTextAccentStyle}" />
								</Grid>
								<Grid Grid.Row="2" >
									<StackPanel HorizontalAlignment="Left" Orientation="Horizontal" >
										<TextBlock Text="{Binding ViewCountText}" Foreground="#99000000" Margin="6,0,0,0" FontSize="16" VerticalAlignment="Center"/>
										<TextBlock Text="{Binding WatchCountText}" Foreground="#99000000" Margin="6,0,0,0" FontSize="16" VerticalAlignment="Center"/>
									</StackPanel>
									<TextBlock Text="{Binding BidCountText}" HorizontalAlignment="Right" Style="{StaticResource PhoneTextAccentStyle}" Margin="0,0,12,0" />
								</Grid>
								<Grid Grid.Row="3" >
									<TextBlock Text="{Binding SellerLocation}" Foreground="#99000000" FontSize="16" Margin="6,0,0,0" />
								</Grid>
							
							</Grid>
						</Border>
					
						<Border Grid.Row="2" Style="{StaticResource TradeMoBorderStyle}" Visibility="{Binding IsMember, Converter={StaticResource VisibilityConverter}, Mode=OneWay}" >
							<Grid>
								<Grid.RowDefinitions>
									<RowDefinition Height="Auto"/>
									<RowDefinition Height="Auto"/>
									<RowDefinition Height="Auto"/>
									<RowDefinition Height="Auto"/>
									<RowDefinition Height="Auto"/>
								</Grid.RowDefinitions>
							
								<TextBlock Text="About the seller" Style="{StaticResource PhoneTextAccentStyle}"/>
								<StackPanel Grid.Row="1" Orientation="Horizontal">
									<TextBlock Text="{Binding Listing.Member.Nickname}" Foreground="Black" VerticalAlignment="Center" Margin="6,0,0,0"/>
									<TextBlock Text="{Binding UniquePositive}" Style="{StaticResource MoTextBlockStyle}"/>
									<Image Source="{Binding Listing.Member.UniquePositive, Converter={StaticResource UniquePositiveConverter}}" Stretch="None"/>
									<Image Source="/Images/icon_av.png" Stretch="None" Visibility="{Binding Listing.Member.IsAddressVerified, Converter={StaticResource VisibilityConverter}}" />
								</StackPanel>
								<TextBlock Grid.Row="2" Text="{Binding PossitiveFeedback, Mode=OneWay}" Style="{StaticResource MoTextBlockStyle}"/>
								<TextBlock Grid.Row="3" Text="{Binding MemberSince}" Style="{StaticResource MoTextBlockStyle}"/>
								<TextBlock Grid.Row="4" Text="Sellers other listings" Style="{StaticResource MoTextBlockStyle}" Visibility="Collapsed" />
							</Grid>
						</Border>
						
						<Border x:Name="DealerDetailsBorder" Grid.Row="3" Style="{StaticResource TradeMoBorderStyle}" 
								Visibility="{Binding IsDealer, Converter={StaticResource VisibilityConverter}, Mode=OneWay}"  >
							<Grid>
								<Grid.RowDefinitions>
									<RowDefinition Height="Auto"/>
									<RowDefinition Height="Auto"/>
									<RowDefinition Height="Auto"/>
									<RowDefinition Height="Auto"/>
									<RowDefinition Height="Auto"/>
									<RowDefinition Height="Auto"/>
								</Grid.RowDefinitions>
								<TextBlock Text="Dealer details" Style="{StaticResource PhoneTextAccentStyle}"/>
								<TextBlock Grid.Row="1" Text="{Binding Listing.Dealership.Name}" Style="{StaticResource MoTextBlockStyle}"/>
								<TextBlock Grid.Row="2" Text="{Binding Listing.Dealership.Address}" Style="{StaticResource MoTextBlockStyle}"/>
								<TextBlock Grid.Row="3" Text="{Binding Listing.Dealership.Suburb}" Style="{StaticResource MoTextBlockStyle}"/>
								<TextBlock Grid.Row="4" Text="{Binding Listing.Dealership.City}" Style="{StaticResource MoTextBlockStyle}"/>
								<TextBlock Grid.Row="5" Text="{Binding Listing.Dealership.PhoneNumber}" Style="{StaticResource MoTextBlockStyle}"/>
								<Button HorizontalAlignment="Right" Style="{StaticResource NoBorderButtonStyle}" Grid.RowSpan="6" Click="DealerButton_Click" VerticalAlignment="Top">
									<Image Source="{Binding Listing.Dealership.Logo}" Stretch="None" />
								</Button>
							</Grid>
						</Border>

						<Border x:Name="AgencyDetailsBorder" Grid.Row="4" Style="{StaticResource TradeMoBorderStyle}" 
								Visibility="{Binding IsAgency, Converter={StaticResource VisibilityConverter}, Mode=OneWay}"  >
							<Grid>
								<Grid.RowDefinitions>
									<RowDefinition Height="Auto"/>
									<RowDefinition Height="Auto"/>
									<RowDefinition Height="Auto"/>
									<RowDefinition Height="Auto"/>
									<RowDefinition Height="Auto"/>
									<RowDefinition Height="Auto"/>
								</Grid.RowDefinitions>
								<TextBlock Text="Agency details" Style="{StaticResource PhoneTextAccentStyle}"/>
								<TextBlock Grid.Row="1" Text="{Binding Listing.Agency.Name}" Style="{StaticResource MoTextBlockStyle}" TextWrapping="Wrap"/>
								<TextBlock Grid.Row="2" Text="{Binding Listing.Agency.Address}" Style="{StaticResource MoTextBlockStyle}"/>
								<TextBlock Grid.Row="3" Text="{Binding Listing.Agency.Suburb}" Style="{StaticResource MoTextBlockStyle}"/>
								<TextBlock Grid.Row="4" Text="{Binding Listing.Agency.City}" Style="{StaticResource MoTextBlockStyle}"/>
								<TextBlock Grid.Row="5" Text="{Binding Listing.Agency.PhoneNumber}" Style="{StaticResource MoTextBlockStyle}"/>
								<Button HorizontalAlignment="Right" Style="{StaticResource NoBorderButtonStyle}" Grid.RowSpan="6" Click="AgencyButton_Click" VerticalAlignment="Top">
									<Image Source="{Binding Listing.Agency.Logo}" Stretch="None" />
								</Button>
							</Grid>
						</Border>

						<Button x:Name="AddWatchListButton" Grid.Row="5"
							Content="Save to Watchlist" Click="AddWatchListButton_Click" Visibility="{Binding ShowSaveToWatchList, Converter={StaticResource VisibilityConverter}}" Style="{StaticResource TradeMoButtonStyle}" />
						<!--Button x:Name="LaunchListingButton" Grid.Row="6"
							Content="Open in Browser" Click="LaunchListingButton_Click" Style="{StaticResource TradeMoButtonStyle}"/ -->
					</Grid>
				</ScrollViewer>
			</controls:PivotItem>

			<controls:PivotItem x:Name="DescriptionPivotItem" Header="description">
				<ScrollViewer Background="#4C000000">
					<Grid >
						<Grid.RowDefinitions>
							<RowDefinition Height="Auto"/>
							<RowDefinition/>
						</Grid.RowDefinitions>
						
						<Border Grid.Row="0" Style="{StaticResource TradeMoBorderStyle}" 
								Visibility="{Binding HasAttributes, Converter={StaticResource VisibilityConverter}, Mode=OneWay}">
							<Grid>
								<ListBox ItemsSource="{Binding Listing.Attributes}" 
										ItemContainerStyle="{StaticResource SearchResultsListBoxItemStyle}"
										ScrollViewer.VerticalScrollBarVisibility="Disabled">
									<ListBox.ItemTemplate>
										<DataTemplate>
											<Grid  d:DesignWidth="480">
												<Grid.ColumnDefinitions>
													<ColumnDefinition/>
													<ColumnDefinition/>
												</Grid.ColumnDefinitions>
												<TextBlock Grid.Column="0" Text="{Binding DisplayName}" Style="{StaticResource MoTextBlockStyle}" Foreground="{StaticResource PhoneAccentBrush}" VerticalAlignment="Top" />
												<TextBlock Grid.Column="1" TextWrapping="Wrap" Text="{Binding Value}" Style="{StaticResource MoTextBlockStyle}" />
											</Grid>
										</DataTemplate>
									</ListBox.ItemTemplate>
								</ListBox>
							</Grid>
						</Border>

						<TextBlock Grid.Row="1"
							HorizontalAlignment="Left" TextWrapping="Wrap" 
							Text="{Binding Listing.Body}" VerticalAlignment="Top" 
							Foreground="White" Style="{StaticResource MoTextBlockStyle}" />
					</Grid>
				</ScrollViewer>
			</controls:PivotItem>
			<controls:PivotItem x:Name="PhotoPivotItem" Header="photos">
				<Grid>
					<ListBox x:Name="ImageList" ItemsSource="{Binding Listing.Photos}" 
						SelectionChanged="ImageList_SelectionChanged" Margin="-12,0" >
						<ListBox.ItemTemplate>
							<DataTemplate>
								<Image Source="{Binding Value.Gallery}" Stretch="None"/>
							</DataTemplate>
						</ListBox.ItemTemplate>
						<ListBox.ItemsPanel>
							<ItemsPanelTemplate>
								<toolkit:WrapPanel/>
							</ItemsPanelTemplate>
						</ListBox.ItemsPanel>
					</ListBox>
				</Grid>
			</controls:PivotItem>
			<controls:PivotItem x:Name="HistoryPivotItem" Header="history">
				<ScrollViewer>
					<Grid>
						<Grid.RowDefinitions>
							<RowDefinition Height="Auto"/>
							<RowDefinition Height="Auto"/>
							<RowDefinition Height="Auto"/>
						</Grid.RowDefinitions>
						
						<Border Grid.Row="0" Style="{StaticResource TradeMoBorderStyle}" >
							<Grid>
								<Grid.RowDefinitions>
									<RowDefinition Height="Auto"/>
									<RowDefinition Height="Auto"/>
								</Grid.RowDefinitions>
							
								<TextBlock Text="Bid history" Style="{StaticResource PhoneTextAccentStyle}"/>
							
								<ListBox Grid.Row="1" 
									ItemTemplate="{StaticResource BidDataTemplate}" 
									ItemContainerStyle="{StaticResource SearchResultsListBoxItemStyle}" 
									ItemsSource="{Binding Bids}" 
									ScrollViewer.VerticalScrollBarVisibility="Disabled"/>
							</Grid>
						</Border>

						<Border Grid.Row="1" Style="{StaticResource TradeMoBorderStyle}" >
							<Grid>
								<Grid.RowDefinitions>
									<RowDefinition Height="Auto"/>
									<RowDefinition Height="Auto"/>
								</Grid.RowDefinitions>
							
								<TextBlock Text="Questions" Style="{StaticResource PhoneTextAccentStyle}"/>
							
								<ListBox Grid.Row="1" ItemsSource="{Binding Questions}" ItemTemplate="{StaticResource QuestionDataTemplate}" ScrollViewer.VerticalScrollBarVisibility="Disabled"/>
							</Grid>
						</Border>
						<Grid Grid.Row="2">
							<Button x:Name="AskQuestionButton" 
								Content="Ask the Seller a Question" Click="AskQuestionButton_Click" 
								Visibility="{Binding IsOpen, Converter={StaticResource VisibilityConverter}, Mode=OneWay}" Style="{StaticResource TradeMoButtonStyle}" />
						</Grid>

					</Grid>
				</ScrollViewer>
			</controls:PivotItem>
			<controls:PivotItem x:Name="BidPivotItem" Header="place bid">
				<ScrollViewer>
					<Grid>
						<Grid.RowDefinitions>
							<RowDefinition Height="Auto"/>
							<RowDefinition Height="Auto"/>
							<RowDefinition Height="Auto"/>
							<RowDefinition Height="Auto"/>
							<RowDefinition Height="Auto"/>
							<RowDefinition Height="Auto"/>
						</Grid.RowDefinitions>
					
						<Border Grid.Row="1" Style="{StaticResource TradeMoBorderStyle}" >
							<Grid>
								<Grid.RowDefinitions>
									<RowDefinition Height="Auto"/>
									<RowDefinition Height="Auto"/>
								</Grid.RowDefinitions>
							
								<TextBlock Text="Payment Options" Style="{StaticResource PhoneTextAccentStyle}"/>
								<TextBlock Grid.Row="1" Text="{Binding Listing.PaymentOptions}" Style="{StaticResource MoTextBlockStyle}"/>
							</Grid>
						</Border>
					
						<Border Grid.Row="2" Style="{StaticResource TradeMoBorderStyle}" >
							<Grid>
								<Grid.RowDefinitions>
									<RowDefinition Height="Auto"/>
									<RowDefinition Height="Auto"/>
								</Grid.RowDefinitions>
							
								<TextBlock Text="Shipping Options" Style="{StaticResource PhoneTextAccentStyle}"/>

								<ListBox Grid.Row="1" ItemsSource="{Binding ShippingOptions}" ScrollViewer.VerticalScrollBarVisibility="Disabled" >
									<ListBox.ItemTemplate>
										<DataTemplate>
											<Grid>
												<RadioButton IsChecked="{Binding IsSelected}" 
													Visibility="{Binding EnableSelection, Converter={StaticResource VisibilityConverter}}"
													GroupName="ShippingOptionGroup" 
													Style="{StaticResource TradeMoRadioButtonStyle}" >
													<Grid>
														<Grid.ColumnDefinitions>
															<ColumnDefinition MinWidth="50" Width="Auto"/>
															<ColumnDefinition/>
														</Grid.ColumnDefinitions>
														<TextBlock Text="{Binding ShippingAmount, Mode=OneWay}" Style="{StaticResource MoTextBlockStyle}" HorizontalAlignment="Right" />
														<TextBlock Grid.Column="1" TextWrapping="Wrap" Text="{Binding ShippingOption.Method}" Style="{StaticResource MoTextBlockStyle}" />
													</Grid>
												</RadioButton>
												<Grid Visibility="{Binding EnableSelection, ConverterParameter=Collapsed, Converter={StaticResource VisibilityConverter}, Mode=OneWay}">
													<Grid.ColumnDefinitions>
														<ColumnDefinition MinWidth="50" Width="Auto"/>
														<ColumnDefinition/>
													</Grid.ColumnDefinitions>
													<TextBlock Text="{Binding ShippingAmount, Mode=OneWay}" Style="{StaticResource MoTextBlockStyle}" HorizontalAlignment="Right" />
													<TextBlock Grid.Column="1" TextWrapping="Wrap" Text="{Binding ShippingOption.Method}" Style="{StaticResource MoTextBlockStyle}" />
												</Grid>
											</Grid>
										</DataTemplate>
									</ListBox.ItemTemplate>
								</ListBox>
							</Grid>
						</Border>
					
						<Grid Grid.Row="3" Visibility="{Binding ShowLoginButton, Converter={StaticResource VisibilityConverter}, Mode=OneWay}" >
							<Button x:Name="LoginButton" Style="{StaticResource TradeMoButtonStyle}">
								<Custom:Interaction.Triggers>
									<Custom:EventTrigger EventName="Click">
										<ic:NavigateToPageAction TargetPage="/TradeMeLoginView.xaml"/>
									</Custom:EventTrigger>
								</Custom:Interaction.Triggers>
								<StackPanel Orientation="Horizontal">
									<Image Stretch="Fill" Width="32" Height="32" Source="/Images/key.png"/>
									<TextBlock Text="Login to bid" Style="{StaticResource PhoneTextLargeStyle}" Foreground="#DEFFFFFF"/>
								</StackPanel>
							</Button>
						</Grid>
					
						<Border Grid.Row="4" Style="{StaticResource TradeMoBorderStyle}" 
							Visibility="{Binding ShowBidGrid, Converter={StaticResource VisibilityConverter}, Mode=OneWay}" >
							<Grid >
								<Grid.ColumnDefinitions>
									<ColumnDefinition />
									<ColumnDefinition />
								</Grid.ColumnDefinitions>
								<Grid.RowDefinitions>
									<RowDefinition Height="Auto"/>
									<RowDefinition Height="Auto"/>
									<RowDefinition/>
									<RowDefinition/>
									<RowDefinition/>
									<RowDefinition/>
									<RowDefinition/>
								</Grid.RowDefinitions>
								<TextBlock Grid.Row="0" Text="Place a bid" Style="{StaticResource PhoneTextAccentStyle}" />
								<TextBlock Grid.Row="1"
									Text="{Binding TitleBids, Mode=OneWay}" 
									Style="{StaticResource MoTextLargeStyle}" Grid.ColumnSpan="2" />
								<Button x:Name="BuyNowButton" Grid.Row="2" Grid.ColumnSpan="2"
									Content="{Binding BuyNowDescription, Mode=OneWay}" 
									Style="{StaticResource TradeMoButtonStyleOnWhite}" 
									Visibility="{Binding Listing.HasBuyNow, Converter={StaticResource VisibilityConverter}}" 
									Click="BuyNowButton_Click" />
								<CheckBox Grid.Row="3" Grid.ColumnSpan="2" IsChecked="{Binding AutoBid, Mode=TwoWay}" Style="{StaticResource TradeMoCheckBoxStyle}">
									<TextBlock Text="Auto bid" Style="{StaticResource MoTextLargeStyle}"/>
								</CheckBox>
								<TextBlock Grid.Row="4" Grid.Column="0" 
									Text="$" Style="{StaticResource MoTextLargeStyle}" VerticalAlignment="Center" />
								<TextBox Grid.Row="4" Grid.Column="0" Style="{StaticResource MoTextBoxStyle}" 
									Text="{Binding BidAmount, Mode=TwoWay}" MinWidth="125" InputScope="Number" Margin="18,0,0,0" />
								<Button x:Name="BidButton" Grid.Row="4" Grid.Column="1"
									Content="Place Bid" Style="{StaticResource TradeMoButtonStyle}" 
									Background="{StaticResource PhoneAccentBrush}" Click="BidButton_Click"/>
							</Grid>
						</Border>
					</Grid>
				</ScrollViewer>
			</controls:PivotItem>
		</controls:Pivot>
		
		<Border x:Name="AskQuestionBorder" Grid.Row="1" Style="{StaticResource TradeMoBorderStyle}" 
				VerticalAlignment="Top" Opacity="0" RenderTransformOrigin="0.5,0.5" Visibility="Collapsed" >
			<Border.RenderTransform>
				<CompositeTransform ScaleX="0.5" ScaleY="0.5"/>
			</Border.RenderTransform>
			<Grid >
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="Auto"/>
					<ColumnDefinition/>
				</Grid.ColumnDefinitions>
				<Grid.RowDefinitions>
					<RowDefinition Height="Auto"/>
					<RowDefinition Height="Auto"/>
				</Grid.RowDefinitions>
				<TextBox TextWrapping="Wrap" Text="{Binding Question, Mode=TwoWay}" MinHeight="200" Style="{StaticResource MoTextBoxStyle}" Grid.ColumnSpan="2" />
				<Button x:Name="CancelQuestionButton" Grid.Row="1" Style="{StaticResource TradeMoButtonStyle}"
						Content="Cancel" Click="CancelQuestionButton_Click" />
				<Button x:Name="SubmitQuestionButton" Grid.Row="1" Style="{StaticResource TradeMoButtonStyle}"
						Content="Submit Question" Background="{StaticResource PhoneAccentBrush}" Grid.Column="1" Click="SubmitQuestionButton_Click"  />
			
			</Grid>
		</Border>

		<Border x:Name="TrialModeBorder" Grid.Row="1" Style="{StaticResource TradeMoBorderStyle}" 
				VerticalAlignment="Top" Opacity="0" RenderTransformOrigin="0.5,0.5" Visibility="Collapsed" 
				>
			<Border.RenderTransform>
				<CompositeTransform ScaleX="0.5" ScaleY="0.5"/>
			</Border.RenderTransform>
			<Grid >
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="Auto"/>
					<ColumnDefinition/>
				</Grid.ColumnDefinitions>
				<Grid.RowDefinitions>
					<RowDefinition Height="Auto"/>
					<RowDefinition Height="Auto"/>
				</Grid.RowDefinitions>
				
				<TextBlock TextWrapping="Wrap" VerticalAlignment="Top" 
						Style="{StaticResource PhoneTextNormalStyle}" Foreground="Black" 
						Grid.ColumnSpan="2" Margin="12,12,12,0"
						Text="Thank you for trying TRADE MObile.  Click Buy to remove this prompt." />
			
				<Button x:Name="ContinueTrialButton" Grid.Row="1" Style="{StaticResource TradeMoButtonStyle}"
					Content="Continue Trial" 
					Click="ContinueTrialButton_Click" Foreground="Black" />
				<Button x:Name="BuyButton" Grid.Row="1" Style="{StaticResource TradeMoButtonStyle}"
					Content="Buy" Background="{StaticResource PhoneAccentBrush}" Grid.Column="1" 
					Click="BuyButton_Click"  />
			
			</Grid>
		</Border>
		
		
		<Grid x:Name="LoadingGrid" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.RowSpan="2" Width="350">
			<ProgressBar Height="10" VerticalAlignment="Top" Style="{StaticResource TradeMoProgressBarStyle}" IsIndeterminate="{Binding IsLoading}"/>
			<TextBlock HorizontalAlignment="Right" Margin="0,0,0,1" TextWrapping="Wrap" Text="Loading . . ." d:LayoutOverrides="Height"/>
		</Grid>
	</Grid>
</CC:AnimatedBasePage>